package cn.edu.nuc.ssm.dao;
import java.util.List;

import cn.edu.nuc.ssm.entity.BorrowMoneyManager;
import org.apache.ibatis.annotations.*;

public interface BorrowMoneyManagerMapper {
    @Delete({
        "delete from borrow_money_manager",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into borrow_money_manager (id, uid, ",
        "money, status, detail, ",
        "record_date)",
        "values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, ",
        "#{money,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER}, #{detail,jdbcType=VARCHAR}, ",
        "#{recordDate,jdbcType=CHAR})"
    })
    int insert(BorrowMoneyManager record);

    int insertSelective(BorrowMoneyManager record);

    @Select({
        "select",
        "id, uid, money, status, detail, record_date",
        "from borrow_money_manager",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("cn.edu.nuc.ssm.dao.BorrowMoneyManagerMapper.BaseResultMap")
    BorrowMoneyManager selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(BorrowMoneyManager record);

    @Update({
        "update borrow_money_manager",
        "set uid = #{uid,jdbcType=INTEGER},",
          "money = #{money,jdbcType=DECIMAL},",
          "status = #{status,jdbcType=INTEGER},",
          "detail = #{detail,jdbcType=VARCHAR},",
          "record_date = #{recordDate,jdbcType=CHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(BorrowMoneyManager record);

    List<BorrowMoneyManager> findbyuidandstatus(@Param("uid")Integer uid,@Param("status")Integer status);

    BorrowMoneyManager findbyId(@Param("id")Integer id);

    int updateStatusbyId(@Param("updatedStatus")Integer updatedStatus,@Param("id")Integer id);


}